/*
 * @Author: SeonHu
 * @Date: 2022-01-12 16:13:29
 * @LastEditTime: 2024-02-02 16:41:05
 * @LastEditors: Seon.Hu SeonHu@126.com
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \vben-admin\src\views\system\report\print\printsetup\printsetup.data.ts
 */
import { AdColumn } from '@/components/AdVxeTable';
import { useI18n } from '@/hooks/web/useI18n';
import { getPrintReportTypeEnumSchema } from '@/enums/report/printReportTypeEnum';

const { t } = useI18n();
const printReportTypeEnumSchema = getPrintReportTypeEnumSchema();

export const printColumns: AdColumn[] = [
  {
    title: t('report.route.print.printSetup.printIdTitle'),
    field: 'Id',
    width: 150,
    formVisible: true,
    formEditable: false,
    filterable: true,
    filterIndex: 'Id',
    dataType: 'integer',
  },
  {
    title: t('report.route.print.printSetup.printCodeTitle'),
    field: 'PrintCode',
    width: 150,
    formVisible: true,
    formEditable: true,
    required: true,
    filterable: true,
    filterIndex: 'PrintCode',
    dataType: 'string',
  },
  {
    title: t('report.route.print.printSetup.printNameTitle'),
    field: 'PrintName',
    width: 100,
    formVisible: true,
    formEditable: true,
    required: true,
    filterable: true,
    filterIndex: 'Name',
    dataType: 'string',
  },
  {
    title: t('report.route.print.printSetup.commentsTitle'),
    field: 'Comments',
    width: 100,
    formVisible: true,
    formEditable: true,
    filterable: true,
    dataType: 'text',
  },
  {
    title: t('report.route.print.printSetup.logEnabledTitle'),
    field: 'LogEnabled',
    width: 110,
    formVisible: true,
    formEditable: true,
    filterable: true,
    dataType: 'boolean',
    formCustomer: {
      colProps: {
        // span: 12,
        xs: 24, // <576px
        sm: 24, // ≥576px
        md: 12, // ≥768px
        lg: 12, // ≥992px
        xl: 12, // ≥1200px
        xxl: 12, // ≥1600px
        // xxxl: 6, // ≥2000px 3.0
      },
    },
  },
  {
    title: t('entity.creationAudited.creatorIdTitle'),
    field: 'CreatorId',
    width: 0,
    visible: false,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'integer',
  },
  {
    title: t('entity.creationAudited.creatorNameTitle'),
    field: 'CreatorName',
    width: 100,
    filterable: true,
    formVisible: true,
    formEditable: false,
    filterIndex: 'CreatorId',
    filterJoin: {
      entityType: 'EaCloud.Pack.Identity.Entities.User,EaCloud.Pack.Identity',
      filterField: 'UserName',
      selectField: 'Id',
    },
    dataType: 'string',
  },
  {
    title: t('entity.creationAudited.creatorNicknameTitle'),
    field: 'CreatorNickname',
    width: 100,
    formVisible: true,
    formEditable: false,
    filterable: true,
    filterIndex: 'CreatorId',
    filterJoin: {
      entityType: 'EaCloud.Pack.Identity.Entities.User,EaCloud.Pack.Identity',
      filterField: 'NickName',
      selectField: 'Id',
    },
    dataType: 'string',
  },
  {
    title: t('entity.creationAudited.createdTimeTitle'),
    field: 'CreatedTime',
    width: 180,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'datetime',
  },
  {
    title: t('entity.updateAudited.updaterIdTitle'),
    field: 'UpdaterId',
    width: 0,
    visible: false,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'integer',
  },
  {
    title: t('entity.updateAudited.updaterNameTitle'),
    field: 'UpdaterName',
    width: 100,
    filterable: true,
    formVisible: true,
    formEditable: false,
    filterIndex: 'UpdaterId',
    filterJoin: {
      entityType: 'EaCloud.Pack.Identity.Entities.User,EaCloud.Pack.Identity',
      filterField: 'UserName',
      selectField: 'Id',
    },
    dataType: 'string',
  },
  {
    title: t('entity.updateAudited.updaterNicknameTitle'),
    field: 'UpdaterNickname',
    width: 100,
    formVisible: true,
    formEditable: false,
    filterable: true,
    filterIndex: 'UpdaterId',
    filterJoin: {
      entityType: 'EaCloud.Pack.Identity.Entities.User,EaCloud.Pack.Identity',
      filterField: 'NickName',
      selectField: 'Id',
    },
    dataType: 'string',
  },
  {
    title: t('entity.updateAudited.updatedTimeTitle'),
    field: 'UpdatedTime',
    width: 180,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'datetime',
  },
  {
    title: t('entity.dataVersion.dataVersionTitle'),
    field: 'DataVersion',
    width: 200,
    formVisible: true,
    formEditable: false,
    filterable: false,
    dataType: 'integer',
  },
];

export const templateColumns: AdColumn[] = [
  {
    title: t('report.route.print.printSetup.templateIdTitle'),
    field: 'Id',
    width: 150,
    formVisible: true,
    formEditable: false,
    filterable: true,
    filterIndex: 'Id',
    dataType: 'integer',
  },
  {
    title: t('report.route.print.printSetup.printIdTitle'),
    field: 'PrintId',
    width: 0,
    visible: false,
    formVisible: true,
    formEditable: false,
    filterable: false,
    dataType: 'integer',
  },
  {
    title: t('report.route.print.printSetup.templateNameTitle'),
    field: 'TemplateName',
    width: 200,
    formVisible: true,
    formEditable: true,
    filterable: true,
    dataType: 'string',
  },
  {
    title: t('report.route.print.printSetup.templateTypeTitle'),
    field: 'TemplateType',
    width: 90,
    formVisible: true,
    formEditable: true,
    required: true,
    filterable: true,
    dataType: 'enum',
    enumData: printReportTypeEnumSchema,
  },
  {
    title: t('report.route.print.printSetup.userAsgnTitle'),
    field: 'UserAsgn',
    width: 80,
    formVisible: true,
    formEditable: true,
    filterable: true,
    dataType: 'boolean',
  },
  {
    title: t('report.route.print.printSetup.orgAsgnTitle'),
    field: 'OrgAsgn',
    width: 80,
    formVisible: true,
    formEditable: true,
    filterable: true,
    dataType: 'boolean',
  },
  {
    title: t('report.route.print.printSetup.commentsTitle'),
    field: 'Comments',
    width: 200,
    formVisible: true,
    formEditable: true,
    filterable: true,
    dataType: 'text',
  },
  {
    title: t('report.route.print.printSetup.logEnabledTitle'),
    field: 'LogEnabled',
    width: 110,
    formVisible: true,
    formEditable: true,
    filterable: true,
    dataType: 'boolean',
  },
  {
    title: t('report.route.print.printSetup.enabledTitle'),
    field: 'Enabled',
    width: 80,
    formVisible: true,
    formEditable: true,
    filterable: true,
    dataType: 'boolean',
  },
  {
    title: t('report.route.print.printSetup.enableFromTitle'),
    field: 'EnableFrom',
    width: 130,
    formVisible: true,
    formEditable: true,
    filterable: true,
    dataType: 'date',
  },
  {
    title: t('report.route.print.printSetup.enableToTitle'),
    field: 'EnableTo',
    width: 130,
    formVisible: true,
    formEditable: true,
    filterable: true,
    dataType: 'date',
  },
  {
    title: t('entity.creationAudited.creatorIdTitle'),
    field: 'CreatorId',
    width: 0,
    visible: false,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'integer',
  },
  {
    title: t('entity.creationAudited.creatorNameTitle'),
    field: 'CreatorName',
    width: 100,
    filterable: true,
    formVisible: true,
    formEditable: false,
    filterIndex: 'CreatorId',
    filterJoin: {
      entityType: 'EaCloud.Pack.Identity.Entities.User,EaCloud.Pack.Identity',
      filterField: 'UserName',
      selectField: 'Id',
    },
    dataType: 'string',
  },
  {
    title: t('entity.creationAudited.creatorNicknameTitle'),
    field: 'CreatorNickname',
    width: 100,
    formVisible: true,
    formEditable: false,
    filterable: true,
    filterIndex: 'CreatorId',
    filterJoin: {
      entityType: 'EaCloud.Pack.Identity.Entities.User,EaCloud.Pack.Identity',
      filterField: 'NickName',
      selectField: 'Id',
    },
    dataType: 'string',
  },
  {
    title: t('entity.creationAudited.createdTimeTitle'),
    field: 'CreatedTime',
    width: 180,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'datetime',
  },
  {
    title: t('entity.updateAudited.updaterIdTitle'),
    field: 'UpdaterId',
    width: 0,
    visible: false,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'integer',
  },
  {
    title: t('entity.updateAudited.updaterNameTitle'),
    field: 'UpdaterName',
    width: 100,
    filterable: true,
    formVisible: true,
    formEditable: false,
    filterIndex: 'UpdaterId',
    filterJoin: {
      entityType: 'EaCloud.Pack.Identity.Entities.User,EaCloud.Pack.Identity',
      filterField: 'UserName',
      selectField: 'Id',
    },
    dataType: 'string',
  },
  {
    title: t('entity.updateAudited.updaterNicknameTitle'),
    field: 'UpdaterNickname',
    width: 100,
    formVisible: true,
    formEditable: false,
    filterable: true,
    filterIndex: 'UpdaterId',
    filterJoin: {
      entityType: 'EaCloud.Pack.Identity.Entities.User,EaCloud.Pack.Identity',
      filterField: 'NickName',
      selectField: 'Id',
    },
    dataType: 'string',
  },
  {
    title: t('entity.updateAudited.updatedTimeTitle'),
    field: 'UpdatedTime',
    width: 180,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'datetime',
  },
  {
    title: t('entity.dataVersion.dataVersionTitle'),
    field: 'DataVersion',
    width: 200,
    formVisible: true,
    formEditable: false,
    filterable: false,
    dataType: 'integer',
  },
];
